{%include file="m.index.header.tpl.php"%}
<!--主体部分-->
<div class="container" style="margin-top:70px;">
    <div class="row row_margin">
        <form name="myform" method="post" action=""  enctype="multipart/form-data">
            <div class="form-group">
                <label for="" class="col-sm-2  control-label">年级：</label>
                <div class="col-sm-10 ">
                    <select class="form-control" name="grade_id" id="grade_id">
                        <option value=""> 全部</option>
                        {%foreach from=$grade_lists key=key item=value%}
                        <option value="{%$value.grade_id%}"{%if $value.grade_id==$grade_id%}selected{%/if%}>{%$value.grade_name%}</option>
                        {%/foreach%}
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label for="" class="col-sm-2  control-label">班级：</label>
                <div class="col-sm-10 ">
                    <select class="form-control" name="class_id" id="class_id">
                        <option value=""> 全部</option>
                        {%foreach from=$class_lists key=key item=value%}
                        <option value="{%$value.class_id%}"{%if $value.class_id ==$class_id%}selected{%/if%}>{%$value.class_name%}</option>
                        {%/foreach%}
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label for="" class="col-sm-2  control-label">标题：</label>
                <div class="col-sm-10 ">
                    <input type="text" class="form-control" value="" name="manage_title">
                </div>
            </div>
            <div class="form-group">
                <label for="" class="col-sm-2  control-label">文章内容：</label>
                <div class="col-sm-10 ">
                    <textarea id="category_content" name="manage_content" rows="12" style="width: 100%"></textarea>                </div>
            </div>
            <div class="form-group">
                <label for="" class="col-sm-2  control-label">附件：</label>
                <div class="col-sm-10 ">
                    <input type="file" name="manage_file" >
                </div>
            </div>
            <div class="row row_margin" >
                <input type="hidden" name="a" value="manage.listjson">
                <button type="submit" class="btn btn-primary btn-lg btn-block btn-primary2">确定</button>
            </div>
        </form>
    </div>
    <!--row  end-->


</div>
<!--container  end-->
<!--主体部分  end-->
<!--底部-->
{%include file="m.index.footer.tpl.php"%}
<!--container  end-->

<!--底部end-->
<script src="mstatic/js/jquery.min.js" type="text/javascript"></script>
<script src="mstatic/js/bootstrap.min.js"  type="text/javascript"></script>
<script src="mstatic/js/jquery-ui.js"  type="text/javascript"></script><!--日历-->

<!--日历-->
<script>
    $(function() {
        $( "#datepicker" ).datepicker({

            changeMonth: true,
            changeYear: true

        });

        $( "#datepicker2" ).datepicker({

            changeMonth: true,
            changeYear: true

        });
    });
</script>

<!--编辑器-->
<script type="text/javascript" src="mstatic/xhe/xheditor-1.2.2.min.js"></script>
<script type="text/javascript" src="mstatic/xhe/xheditor_lang/zh-cn.js"></script>
!-- 二级联动 -->
<script type="text/javascript">
    $(document).ready(function () {
        $("#grade_id").change(function () {
            if ($(this).val() == "-1") {
                $("#industr").remove(); return;
            }
            else {
                var timestamp = new Date().getTime();
                $.ajax({
                    url:"index.php?a=student.gradelistjson",
                    type:"get",
                    data: "grade_id=" + $("#grade_id").find("option:selected").val() + "&timestamp=" + timestamp,
                    dataType:"json",
                    success:function(msg){

                        //实例2个字符串变量来拼接下拉列表
                        var industr = "";
                        //使用jquery解析json中的数据
                        $.each(msg, function (n, value) {
                            industr += ("<option value=\"" + value.class_id + "\">" + value.class_name);
                            industr += ("</option>");
                        });

                        $("#class_id").html(industr);
                    }
                });

            }

        });

    });
</script>
<script type="text/javascript">
    $(pageInit);
    function pageInit()
    {
        $.extend(XHEDITOR.settings,{shortcuts:{'ctrl+enter':submitForm}});//修改默认设置
        $('#category_content').xheditor({modalWidth:700,modalHeight:500,upBtnText:'浏览',upLinkUrl:"!ckfinder/upload.html",upImgUrl:"!ckfinder/upload.html?type=Images",upFlashUrl:"!ckfinder/upload.html?type=Flash",upMediaUrl:"!ckfinder/upload.html"});
    }
    function submitForm(){$('#myform').submit();}
</script>
</body>
</html>
